package com.zzw.bridge.business.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zzw.bridge.business.dto.FileReportQueryDTO;
import com.zzw.bridge.business.dto.LikeFileDTO;
import com.zzw.bridge.business.service.ZzwFileReportAssociationService;
import com.zzw.bridge.business.vo.FileReportQueryVo;
import com.zzw.bridge.common.utils.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;

/**
 * 点云文件与墩柱报告关系表
 *
 * @author XiaoJie
 * @date 2025-05-22 14:17:46
 */

@Tag(name = "点云文件与墩柱报告关系控制器")
@RestController
@RequestMapping("business/fileReport")
public class ZzwFileReportAssociationController {
    @Resource
    private ZzwFileReportAssociationService reportAssociationService;

    @PostMapping("/queryPage")
    @Operation(summary = "分页查询")
    public Result<Page<FileReportQueryVo>> queryPage (@RequestBody FileReportQueryDTO dto) {
        return Result.ok(reportAssociationService.queryPage(dto));
    }

    @PostMapping("/queryAllByFileSuffix")
    @Operation(summary = "根据文件后缀获取所有文件信息（例如：fileSuffix:'.json'）")
    public Result<List<FileReportQueryVo>> queryAllByFileSuffix (@RequestBody LikeFileDTO dto) {
        return Result.ok(reportAssociationService.queryAllByFileSuffix(dto));
    }

}
